package com.leetcode.algorithm.y22.m09.w2;

/**
 * 1323. 6 和 9 组成的最大数字
 * 
 * https://leetcode.cn/problems/maximum-69-number/
 * 
 * @author jie.deng
 *
 */
class Question1323Solution01 {

	public int maximum69Number(int num) {
		char[] chars = ("" + num).toCharArray();
		for (int i = 0; i < chars.length; i++) {
			if (chars[i] == '6') {
				chars[i] = '9';
				break;
			}
		}
		return Integer.parseInt(new String(chars));
	}

}